﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="ThietBiSo.LinQDB" %>
<%@ Import Namespace="ThietBiSo.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Website - bảng điều khiển
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table width="100%" cellpadding="2" cellspacing="0" border="0">
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td>
                            <%= Html.ActionLink("Thêm quảng cáo", "Create",null, new { @class = "classThem" })%>
                        </td>
                        <td align="right">
                            <%: Html.ActionLink("Quay lại", "quantri", "Admin", null, new { @class = "" })%>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <table id="bang_admin" class="tbl colorize" width="100%" border="0">
                    <tbody>
                        <tr>
                          
                            <th align="center" width="50">
                                TT
                            </th>
                            <th align="center" width="50">
                                Sửa
                            </th>
                            <th>
                                Liên kết
                            </th>
                            <th>
                                Vị trí
                            </th>
                            <th>
                                Target
                            </th>
                            <th>
                                Loại
                            </th>
                            <th width="100" align="center">
                                Hiển thị
                            </th>
                            <th align="center" width="60">
                                Xóa
                            </th>
                        </tr>
                    </tbody>
                    <tbody>
                        <% foreach (QuangCao sp in (List<QuangCao>)ViewData["quangcaos"])
                           {               
                        %>
                        <tr class="tb_hienthi">
                           
                            <td align="center" valign="middle">
                                <input type="text"disabled="disabled" autocomplete="off" class="orderbox" value="<%:sp.ThuTu %>" maxlength="4"
                                    id="thutu" style="width: 20px;" />&nbsp;
                            </td>
                            <td align="center" valign="middle">
                                <% if (sp.LoaiQuangCao == 1)
                                   { %>
                                <% if (sp.HinhAnh == "" || sp.HinhAnh == null || sp.HinhAnh == "noImage")
                                   { %>
                                <a href="<%=Url.Action("Edit","QuangCao", new { id = sp.MaQuangCao } ) %>">
                                    <img src="<%:Url.Content("~/Content/images/nophoto.gif")%>" alt="" width="50px;"
                                        height="50px;" />
                                </a>
                                <%} %>
                                <a href="<%=Url.Action("Edit","QuangCao", new { id = sp.MaQuangCao } ) %>">
                                    <img src="<%: sp.HinhAnh%>" alt="" width="50px;" height="50px;" />
                                </a>
                                <%}
                                   else if (sp.LoaiQuangCao == 2)
                                   { %>
                                <a href="<%=Url.Action("Edit","QuangCao", new { id = sp.MaQuangCao } ) %>">
                                    <img src="<%:Url.Content("~/Content/images/flash.png")%>" alt="" width="50px;"
                                        height="50px;" />
                                </a>
                                <%} %>
                            </td>
                            <td align="left">
                                <%: sp.Link%>
                            </td>
                            <td align="left">
                                <%: sp.ViTriQuangCao.ViTri%>
                            </td>
                            <td align="left">
                                <%: sp.TargetQuangCao.Target%>
                            </td>
                            <td align="left">
                                <%: sp.LoaiQuangCao1.TenLoaiQuangCao%>
                            </td>
                            <td align="center">
                                <%if (sp.HienThi == false)
                                  {
                                %>
                                <a href="javascript:quangcao_trangchu(<%:sp.MaQuangCao%>);">
                                    <input type="checkbox" />
                                </a>
                                <%}
                                  else
                                  {%>
                                <a href="javascript:quangcao_trangchu(<%:sp.MaQuangCao%>);">
                                    <input type="checkbox" checked="checked" /></a>
                                <%} %>
                            </td>
                            <td align="center">
                                <a href="javascript:quangcao_delete(<%:sp.MaQuangCao %>);">
                                    <img src="../../Content/imagesAdmin/images/pic_trash.gif" alt="" /></a>
                            </td>
                        </tr>
                        <% } %>
                    </tbody>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
